<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html>
<head>
<title>商品品牌</title>
<%@ include file="../../../common/admin_taglib.jsp" %>
<link rel="stylesheet" type="text/css" href="${ctx}/resources/js/jquery-easyui-1.3.3/themes/bootstrap/easyui.css">
<link rel="stylesheet" type="text/css" href="${ctx}/resources/js/jquery-easyui-1.3.3/themes/icon.css">
<link rel="stylesheet" type="text/css" href="${ctx}/resources/js/jquery-easyui-portal/portal.css">
<script type="text/javascript" src="${ctx}/resources/js/jquery-easyui-1.3.3/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${ctx}/resources/js/jquery-easyui-1.3.3/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="${ctx}/resources/js/jquery-easyui-portal/jquery.portal.js"></script>
<script type="text/javascript">
$(function(){
	$("#pp").portal({
		border:false,
		fit:false
	});
	$("#deleteConfirm_ok").click(function(){
		if (bid > 0)
			location.href = "${ctx}/admin/brand/delete/" +　bid;
	});
});
var bid = 0;
function deleteItem(brandId) {
	$("#deleteConfirm").modal("show");
	bid = brandId;
}
</script>
<style type="text/css">
.partal_item {background:#f3eeaf;padding:5px;}
.partal_item img {width:100%;height:150px;margin-bottom:5px;}
</style>
</head>
<body>

<dd:messager id="deleteConfirm" type="confirm"></dd:messager>

<h1 class="page-title">Shop4j 管理中心</h1>
<ul class="breadcrumb">
	 <li><a href="${ctx}/admin/main">管理中心</a><span class="divider">/</span></li>
     <li class="active">商品品牌</li>
</ul>

<div class="row-fluid">
	<div class="btn-toolbar">
	    <a href="${ctx}/admin/brand/insert" class="btn btn-primary"><i class="icon-plus"></i>添加商品品牌</a>
	  	<a href="javascript:reloadGrid();" class="btn">刷新</a>
	  	<div class="btn-group"></div>
	</div>
	<div class="well" style="padding:0px;">
		<div id="pp">
			<div style="width:30%">
				<c:forEach items="${brand_list}" var="b" varStatus="i">
					<c:if test="${(i.index + 1) % 3 == 1}">
					<div title="${b.name}" class="partal_item">
						<a href="${b.linkUrl}" target="_blank">
							<c:choose>
								<c:when test="${fn:startsWith(b.logoUrl, 'http')}">
									<img alt="${b.name}" src="${b.logoUrl}">
								</c:when>
								<c:otherwise>
									<img alt="${b.name}" src="${ctx}/${b.logoUrl}">
								</c:otherwise>
							</c:choose>
						</a>
						<a class="btn btn-middle btn-info icon-pencil span6" style="float:left;" href="${ctx}/admin/brand/update/${b.id}"> 编辑</a>
						<a class="btn btn-middle btn-danger icon-minus span6" style="float:right;" href="javascript:deleteItem(${b.id});"> 删除</a>
					</div>
					</c:if>
				</c:forEach>
			</div>
			<div style="width:30%">
				<c:forEach items="${brand_list}" var="b" varStatus="i">
					<c:if test="${(i.index + 1) % 3 == 2}">
					<div title="${b.name}" class="partal_item">
						<a href="${b.linkUrl}" target="_blank">
							<c:choose>
								<c:when test="${fn:startsWith(b.logoUrl, 'http')}">
									<img alt="${b.name}" src="${b.logoUrl}">
								</c:when>
								<c:otherwise>
									<img alt="${b.name}" src="${ctx}/${b.logoUrl}">
								</c:otherwise>
							</c:choose>
						</a>
						<a class="btn btn-middle btn-info icon-pencil span6" style="float:left;" href="${ctx}/admin/brand/update/${b.id}"> 编辑</a>
						<a class="btn btn-middle btn-danger icon-minus span6" style="float:right;" href="javascript:deleteItem(${b.id});"> 删除</a>
					</div>
					</c:if>
				</c:forEach>
			</div>
			<div style="width:30%">
				<c:forEach items="${brand_list}" var="b" varStatus="i">
					<c:if test="${(i.index + 1) % 3 == 0}">
					<div title="${b.name}" class="partal_item">
						<a href="${b.linkUrl}" target="_blank">
							<c:choose>
								<c:when test="${fn:startsWith(b.logoUrl, 'http')}">
									<img alt="${b.name}" src="${b.logoUrl}">
								</c:when>
								<c:otherwise>
									<img alt="${b.name}" src="${ctx}/${b.logoUrl}">
								</c:otherwise>
							</c:choose>
						</a>
						<a class="btn btn-middle btn-info icon-pencil span6" style="float:left;" href="${ctx}/admin/brand/update/${b.id}"> 编辑</a>
						<a class="btn btn-middle btn-danger icon-minus span6" style="float:right;" href="javascript:deleteItem(${b.id});"> 删除</a>
					</div>
					</c:if>
				</c:forEach>
			</div>
		</div>
	</div>
</div>

</body>
</html>